<template>
    <div class="swiper-container" v-show="List.length>0">
        <div class="swiper-wrapper">
            <div class="swiper-slide" v-for="item of List" :key="item.id">
                <img class="swiper-img" :src='item'>
            </div>
        </div>

    </div>
</template>

<script>
import Swiper from 'swiper/js/swiper.min.js'
import 'swiper/css/swiper.min.css'

export default {
    name: 'HomeSwiper',
    props: {
        List: Array
    },
    mounted() {
        new Swiper('.swiper-container', {

            loop: true, // 循环模式选项
            observer: true,
            observeParents: true,



        })
    }
}
</script>

<style lang="stylus" scoped>
   .swiper-wrapper 
        width 100%
        height 0
        padding-bottom: 20.8%
        .swiper-img
            width 100%

</style>